<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateAdminRole extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        /**
         * (
        `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
        `name` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
        `remark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
        `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1:启用，0：未启用',
        `created_at` timestamp(0) NULL DEFAULT NULL,
        `updated_at` timestamp(0) NULL DEFAULT NULL,
        `deleted_at` timestamp(0) NULL DEFAULT NULL,
         */
        Schema::create('admin_role', function (Blueprint $table) {
            $table->integerIncrements('id');
            $table->string('name', 24);
            $table->string('remark', 32)->default('');
            $table->unsignedTinyInteger('status')->default(0)->comment('1:启用，0：未启用');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('admin_role');
    }
}
